package com.eneat.smartrule.restAPI;

public enum ResultCode {
    SUCCESS(0, "success"), // 正确请求
    REPEAT_REQ(133, "duplicated req"), // 重复请求
    SYSTEM_ERROR(1, "failure"),// 请求错误
    INVALID_PARAM(1300, "invalid params"),
    MISTYPE_PARAM(1301, "mistype params"),
    MISSING_PARAM(1302, "missing params"),
    UNSUPPORTED_METHOD(1303, "unsupported method");

    /**
     * 主键
     */
    private final Integer code;

    /**
     * 描述
     */
    private final String Message;

    ResultCode(final Integer code, final String msg) {
        this.code = code;
        this.Message = msg;
    }

    public Integer getCode() {
        return code;
    }

    public String getMessage() {
        return this.Message;
    }

    @Override
    public String toString() {
        return this.getMessage();
    }
}
